<?php

 

class Application_Model_UnionUser_alipay extends Application_Model_UnionUser_Base {

    const loginUrl = 'http://www.uuch.com/user/alipay';    
    
    public function getLoginUrl() {
        return loginUrl;
    }
    
    public function getUnionName() {
        return '支付宝';
    }
    
    public function isValid() {
        require_once APPLICATION_PATH . '/configs/login/alipay/alipay.config.php';  
        require_once APPLICATION_PATH . '/configs/login/alipay/lib/alipay_notify.class.php';
        $alipayNotify = new AlipayNotify($aliapy_config);
        $verify_result = $alipayNotify->verifyReturn();
        return $verify_result;
    }
    
    public function getUserInfo() {
        $result = new Application_Model_UnionUser_UserInfo();
        $result->nickname = $_GET['real_name'];
        $result->userKey = $this->getUserKey();
        return $result;
    }
    
    public function getUserKey() {
        return $_GET['user_id']; //用户id;
    }

}